package com.xhwl.logistics.enums;


import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
public enum VehicleParkingLotCarAuthEnum {

    VEHICLE_PARKINGLOT_NOTHING(-1,"vehicleParkingLotNothingCarAuthHandlerImpl");

    VehicleParkingLotCarAuthEnum(Integer productId,String handlerName){
        this.productId = productId;
        this.handlerName = handlerName;
    }

    private final Integer productId;

    private final String handlerName;

    public static VehicleParkingLotCarAuthEnum toVehicleParkingLotCarAuthEnum(Integer productId){
        for (VehicleParkingLotCarAuthEnum value : VehicleParkingLotCarAuthEnum.values()) {
            if(StringUtils.equals(value.getProductId().toString(),productId.toString())){
                return value;
            }
        }
        return VEHICLE_PARKINGLOT_NOTHING;
    }
}
